from flask import Flask, session

app = Flask(__name__, instance_relative_config=True)
app.config.from_object('config')
# Instance config (in instance/config.py) which must contains admin account info and database URI (refer to project's repo for more info)
app.config.from_pyfile('config.py')

from .utils import *
app.jinja_env.globals['sorted'] = sorted
app.jinja_env.globals['type'] = type
app.jinja_env.globals['len'] = len
app.jinja_env.globals['csrf_token'] = generate_csrf_token
from .views.wiki import wiki
from .views.admin import admin

app.register_blueprint(wiki)
app.register_blueprint(admin, url_prefix='/admin')